package com.tv189.springbatchtest.steplisten;

import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;

/**
 * @ClassName: MyStepListener
 * @Description: 步骤监听器
 * @Author: 19202
 * @Date: 2025/5/28 22:04
 * @Version 1.0
 **/
public class MyStepListener implements StepExecutionListener {

    /**
     * @param stepExecution
     */
    @Override
    public void beforeStep(StepExecution stepExecution) {
        System.out.println("-----------beforeStep----------");
    }

    /**
     * @param stepExecution
     * @return
     */
    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        System.out.println("---------afterStep-------");
        return stepExecution.getExitStatus();
    }
}
